<?
// Variables de limpieza
function clean_string($value)
	{
	$value = strip_tags($value);
	$malo = array("\\",";","\'","'","<",">","$","%"); // Aqui poner caracteres no permitidos
	$i = 0;
	$o = count($malo);
	while($i<=$o)
		{
		$value = str_replace($malo[$i],"",$value);
		$i++;
		}
	return $value;
	}

function checamail($email)
	{
	$mail_correcto = 0;
	if((strlen($email) >= 6) && (substr_count($email,"@") == 1) && (substr($email,0,1) != "@") && (substr($email,strlen($email)-1,1) != "@"))
		{
		if((!strstr($email,"'")) && (!strstr($email,"\"")) && (!strstr($email,"\\")) && (!strstr($email,"\$")) && (!strstr($email," ")))
			{
			if(substr_count($email,".")>= 1)
				{
				$term_dom = substr(strrchr ($email, '.'),1);
				if(strlen($term_dom)>1 && strlen($term_dom)<5 && (!strstr($term_dom,"@")))
					{
					$antes_dom = substr($email,0,strlen($email) - strlen($term_dom) - 1);
					$caracter_ult = substr($antes_dom,strlen($antes_dom)-1,1);
               		if($caracter_ult != "@" && $caracter_ult != ".")
						{
						$mail_correcto = 1;
						}
					}
				}
			}
		}
	require('abrirdb.php');
	$busco = mysql_query("select * from cliente where email = '$email'");
	if(mysql_num_rows($busco)==0)
		{ $mail_correcto = 1; }
	return $mail_correcto;
	}
	
function fancybasic()
	{
	$text = '
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
	<script> !window.jQuery && document.write(\'<script src="jquery-1.4.3.min.js"><\/script>\');</script>
	<script type="text/javascript" src="fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
	<script type="text/javascript" src="fancybox/jquery.fancybox-1.3.4.pack.js"></script>
	<link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox-1.3.4.css" media="screen" />
	<script type="text/javascript">
		$(document).ready(
		function()
			{ 
			$("#bienvenido").fancybox({
			\'width\'			: 720,
			\'height\'		: 450,
			\'autoScale\'		: false,
			\'transitionIn\'	: \'elastic\',
			\'transitionOut\'	: \'elastic\',
			\'type\'			: \'iframe\' });
			$("#login").fancybox({
			\'width\'			: 300,
			\'height\'		: 210,
			\'autoScale\'		: false,
			\'transitionIn\'	: \'elastic\',
			\'transitionOut\'	: \'elastic\',
			\'type\'			: \'iframe\' });
			$("#tipocte").fancybox({
			\'width\'			: 270,
			\'height\'		: 100,
			\'autoScale\'		: false,
			\'transitionIn\'	: \'elastic\',
			\'transitionOut\'	: \'elastic\',
			\'type\'			: \'iframe\' });} );
	</script>';
	return $text;
	}
// Modulos de Perfil Experiencia
function expertise($idcliente)
	{
	require('abrirdb.php');
	$sql = mysql_query("SELECT * FROM perfil_expertos where id_cliente = '$idcliente'");
	$array = mysql_fetch_array($sql);
	$text = '
	<tr><td width="3%" class="perfilsubtit">&nbsp;</td>
		<td width="97%" bgcolor="#f6f6f6" class="perfilsubtit" height="21">&nbsp;Expertos en&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		(<a href="miperfil.php?module=expertise">Editar</a>)</td></tr>
	<tr><td>&nbsp;</td><td height="20" align="left" class="black12">'.$array['expertise1'].'</td></tr>
    <tr><td>&nbsp;</td><td height="20" align="left" class="black12">'.$array['expertise2'].'</td></tr>
    <tr><td>&nbsp;</td><td height="20" align="left" class="black12">'.$array['expertise3'].'</td></tr>
    <tr><td>&nbsp;</td><td height="20" align="left" class="black12">'.$array['expertise4'].'</td></tr>
    <tr><td>&nbsp;</td><td height="20" align="left" class="black12">'.$array['expertise5'].'</td></tr>
    <tr><td>&nbsp;</td><td height="20" align="left" class="black12">'.$array['expertise6'].'</td></tr>
    <tr><td>&nbsp;</td><td height="20" align="left" class="black12">'.$array['expertise7'].'</td></tr>
    <tr><td>&nbsp;</td><td height="20" align="left" class="black12">'.$array['expertise8'].'</td></tr>
    <tr><td colspan="2"><div align="left">&nbsp;</div></td></tr>';
	return $text;
	}

function expertise_config($idcliente)
	{
	require('abrirdb.php');
	$sql = mysql_query("SELECT * FROM perfil_expertos where id_cliente = '$idcliente'");
	$array = mysql_fetch_array($sql);
	$text = '
	<tr><td width="3%" class="perfilsubtit">&nbsp;</td>
		<td width="97%" bgcolor="#f6f6f6" class="perfilsubtit" height="21">&nbsp;Expertos en&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		(<a href="miperfil.php">Regresar</a>)</td></tr>
	<tr><td>&nbsp;</td><td height="20" align="left"><input name="expert1" id="expert1" type="text" value="'.$array['expertise1'].'" class="cajasafiliate" /></td></tr>
    <tr><td>&nbsp;</td><td height="20" align="left"><input name="expert2" id="expert2" type="text" value="'.$array['expertise2'].'" class="cajasafiliate" /></td></tr>
    <tr><td>&nbsp;</td><td height="20" align="left"><input name="expert3" id="expert3" type="text" value="'.$array['expertise3'].'" class="cajasafiliate" /></td></tr>
    <tr><td>&nbsp;</td><td height="20" align="left"><input name="expert4" id="expert4" type="text" value="'.$array['expertise4'].'" class="cajasafiliate" /></td></tr>
    <tr><td>&nbsp;</td><td height="20" align="left"><input name="expert5" id="expert5" type="text" value="'.$array['expertise5'].'" class="cajasafiliate" /></td></tr>
    <tr><td>&nbsp;</td><td height="20" align="left"><input name="expert6" id="expert6" type="text" value="'.$array['expertise6'].'" class="cajasafiliate" /></td></tr>
    <tr><td>&nbsp;</td><td height="20" align="left"><input name="expert7" id="expert7" type="text" value="'.$array['expertise7'].'" class="cajasafiliate" /></td></tr>
    <tr><td>&nbsp;</td><td height="20" align="left"><input name="expert8" id="expert8" type="text" value="'.$array['expertise8'].'" class="cajasafiliate" /></td></tr>
    <tr><td>&nbsp;</td><td align="left"><input name="act_expertise" type="submit" value="Actualizar Expertos" /></td></tr>';
	return $text;
	}
//Modulos de Datos Globales
function pglobal($idcliente)
	{
	require('abrirdb.php');
	$sql = mysql_query("SELECT * FROM perfil_global where id_cliente = '$idcliente'");
	$array = mysql_fetch_array($sql);
	$text = '
		<tr><td class="perfiltitle" height="30">'.$array['titulo'].'</td><td class="style2">(<a href="miperfil.php?module=global" class="style2"><strong>Editar</strong></a>)</td></tr>
		<tr><td colspan="2" align="left" class="perfilsubtit" height="25">'.$array['status'].'</td></tr>';
	return $text;
	}

function buscamilogo($idperfil)
	{
	require('abrirdb.php');
	$buss = mysql_query("SELECT * FROM cliente where id_cliente = '$idperfil'");
	$result = mysql_fetch_array($buss);
	$text = $result['agente'];
	return $text;
	}
	
function pglobal_config($idcliente)
	{
	require('abrirdb.php');
	$sql = mysql_query("SELECT * FROM perfil_global where id_cliente = '$idcliente'");
	$array = mysql_fetch_array($sql);
	$text = '
	<tr><td class="perfiltitle"><input id="titulo" name="titulo" type="text" value="'.$array['titulo'].'" class="cajasafiliate" size="50" /></td>
    	<td class="style2">(<a href="miperfil.php" class="style2"><strong>Regresar</strong></a>)</td></tr>
	<tr><td colspan="2" class="perfilsubtit"><input id="status" name="status" type="text" value="'.$array['status'].'" class="cajasafiliate" size="50" /></td></tr>
	<tr><td colspan="2" class="perfilsubtit"><input name="act_global" type="submit" value="Actualizar Status" /></td></tr>';
	return $text;
	}
// Informacion del Perfil
function informacion_perfil($idcliente)
	{
	require('abrirdb.php');
	$sql = mysql_query("SELECT * FROM perfil_informacion where id_cliente = '$idcliente'");
	$array = mysql_fetch_array($sql);
	$text = '
	<div style="padding:5px 15px 0 15px">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="3" height="21" class="style2"><a href="miperfil.php?module=pinformacion" class="style2">Editar Informaci&oacute;n de Perfil</a></td></tr>
		<tr><td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Empresa/Misi&oacute;n/Visi&oacute;n</td><td class="perfilsubtit">&nbsp;</td>
		  	<td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Te podemos ayudar en</td></tr>
		<tr><td height="21" class="black12" style="vertical-align:top">'.nl2br($array['acerca']).'</td><td class="perfilsubtit">&nbsp;</td>
			<td height="21" class="black12" style="vertical-align:top">'.nl2br($array['expertos']).'</td></tr>
		<tr><td height="21" class="perfilsubtit">&nbsp;</td><td class="perfilsubtit">&nbsp;</td><td height="21" class="perfilsubtit">&nbsp;</td></tr>
		<tr><td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Contacto</td><td class="perfilsubtit">&nbsp;</td>
			<td height="21" class="perfilsubtit" style="background-color:#D4EDFE">&nbsp;Ubicaci&oacute;n</td></tr>
		<tr><td height="21" class="black12" style="vertical-align:top">'.nl2br($array['telefonos']).'</td><td class="perfilsubtit">&nbsp;</td>
			<td height="21" class="black12" style="vertical-align:top">'.nl2br($array['ubicacion']).'</td></tr>
		<tr><td height="21" class="perfilsubtit">&nbsp;</td><td class="perfilsubtit">&nbsp;</td><td height="21" class="perfilsubtit">&nbsp;</td></tr>
		<tr><td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Horario</td><td class="perfilsubtit">&nbsp;</td>
			<td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Sitio Web</td></tr>
		<tr><td height="21" class="black12" style="vertical-align:top">'.nl2br($array['horario']).'</td><td class="perfilsubtit">&nbsp;</td>
			<td height="21" class="black12" style="vertical-align:top"><a href="http://'.$array['sitio'].'" target="_blank">http://'.$array['sitio'].'</a></td></tr>
		<tr><td height="21" class="perfilsubtit">&nbsp;</td><td class="perfilsubtit">&nbsp;</td><td height="21" class="perfilsubtit">&nbsp;</td></tr>
		<tr><td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Noticias</td><td class="perfilsubtit">&nbsp;</td>
			<td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Otro</td></tr>
		<tr><td height="21" class="black12" style="vertical-align:top">'.nl2br($array['noticias']).'</td><td class="perfilsubtit">&nbsp;</td>
			<td height="21" class="black12" style="vertical-align:top">'.nl2br($array['recibimos']).'</td></tr>
		<tr><td width="48%" height="21" class="perfilsubtit">&nbsp;</td><td width="4%" class="perfilsubtit">&nbsp;</td><td width="48%" height="21" class="perfilsubtit">&nbsp;</td></tr>
		<tr><td colspan="3">&nbsp;</td></tr>
	</table></div>';
	return $text;
	}
	
function pinformacion($idcliente)
	{
	require('abrirdb.php');
	$sql = mysql_query("SELECT * FROM perfil_informacion where id_cliente = '$idcliente'");
	$array = mysql_fetch_array($sql);
	$text = '
    <form action="actions.php" method="post">
	<div style="padding:5px 15px 0 15px">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td height="21" class="style2" colspan="3"><a href="miperfil.php?subsection=informacion" class="style2">Regresar al Perfil</a></td></tr>
		<tr><td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Empresa/Misi&oacute;n/Visi&oacute;n</td><td class="perfilsubtit">&nbsp;</td>
		  	<td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Te podemos ayudar en</td></tr>
		<tr><td align="center"><textarea name="acerca" cols="45" rows="3" id="acerca">'.$array['acerca'].'</textarea></td><td>&nbsp;</td>
			<td align="center"><textarea name="expertos" cols="45" rows="3" id="exertos">'.$array['expertos'].'</textarea></td></tr>
		<tr><td height="21" class="perfilsubtit">&nbsp;</td><td class="perfilsubtit">&nbsp;</td><td height="21" class="perfilsubtit">&nbsp;</td></tr>
		<tr><td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Telefono</td><td class="perfilsubtit">&nbsp;</td>
			<td height="21" class="perfilsubtit" style="background-color:#D4EDFE">&nbsp;Ubicaci&oacute;n</td></tr>
		<tr><td align="center"><textarea name="telefonos" cols="45" rows="3" id="telefonos">'.$array['telefonos'].'</textarea></td><td>&nbsp;</td>
			<td align="center"><textarea name="ubicacion" cols="45" rows="3" id="ubicacion">'.$array['ubicacion'].'</textarea></td></tr>
		<tr><td height="21" class="perfilsubtit">&nbsp;</td><td class="perfilsubtit">&nbsp;</td><td height="21" class="perfilsubtit">&nbsp;</td></tr>
		<tr><td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Horario</td><td class="perfilsubtit">&nbsp;</td>
			<td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Sitio Web</td></tr>
		<tr><td align="center"><textarea name="horario" cols="45" rows="3" id="horario">'.$array['horario'].'</textarea></td><td>&nbsp;</td>
			<td align="center"><input name="sitio" type="text" id="sitio" value="'.$array['sitio'].'" size="30" /></td></tr>
		<tr><td height="21" class="perfilsubtit">&nbsp;</td><td class="perfilsubtit">&nbsp;</td><td height="21" class="perfilsubtit">&nbsp;</td></tr>
		<tr><td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Noticias</td><td class="perfilsubtit">&nbsp;</td>
			<td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Otro</td></tr>
		<tr><td align="center"><textarea name="noticias" cols="45" rows="3" id="noticias">'.$array['noticias'].'</textarea></td><td>&nbsp;</td>
			<td align="center"><textarea name="recibimos" cols="45" rows="3" id="recibimos">'.$array['recibimos'].'</textarea></td></tr>
		<tr><td width="48%" height="21">&nbsp;</td><td width="4%">&nbsp;</td><td width="48%">&nbsp;</td></tr>
		<tr><td colspan="3">&nbsp;</td></tr>
		<tr><td colspan="3" align="center"><input name="act_informacion" type="submit" value="Actualizar Informaci&oacute;n" /></td></tr>
		<tr><td colspan="3">&nbsp;</td></tr>
		<tr><td colspan="3">&nbsp;</td></tr>
	</table></div></form>';
	return $text;
	}
// Modulo de Promociuones
function promocion_perfil($idcliente)
	{
	require('abrirdb.php');
	$sql = mysql_query("SELECT * FROM perfil_promocion where id_cliente = '$idcliente'");
	$array = mysql_fetch_array($sql);
	$text = '
	<div style="padding:5px 15px 0 15px">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="3" height="21" class="style2"><a href="miperfil.php?module=ppromocion class="style2"">Editar Promciones</a></td></tr>
		<tr><td width="48%" height="21" class="perfilsubtit" style="background-color:#D4EDFE">Promociones</td><td width="4%">&nbsp;</td>
		  	<td width="48%" height="21" class="perfilsubtit" style="background-color:#D4EDFE">Promociones</td></tr>
		<tr><td class="black12" style="vertical-align:top" align="justify">'.nl2br($array['promocion1']).'</td><td>&nbsp;</td>
            <td class="black12" style="vertical-align:top" align="justify">'.nl2br($array['promocion2']).'</td></tr>
		<tr><td height="21">&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
		<tr><td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Promociones</td><td>&nbsp;</td>
            <td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Promociones</td></tr>
		<tr><td class="black12" style="vertical-align:top" align="justify">'.nl2br($array['promocion3']).'</td><td>&nbsp;</td>
        	<td class="black12" style="vertical-align:top" align="justify">'.nl2br($array['promocion4']).'</td></tr>
		<tr><td height="21">&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
	</table></div>';
	return $text;
	}

function ppromocion($idcliente)
	{
	require('abrirdb.php');
	$sql = mysql_query("SELECT * FROM perfil_promocion where id_cliente = '$idcliente'");
	$array = mysql_fetch_array($sql);
	$text = '
	<form action="actions.php" method="post">
	<div style="padding:5px 15px 0 15px">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td height="21" class="style2" colspan="3"><a href="miperfil.php?subsection=promocion" class="style2">Regresar a Perfil</a></td></tr>
		<tr><td width="48%" height="21" class="perfilsubtit" style="background-color:#D4EDFE">Promociones</td><td width="4%">&nbsp;</td>
		  	<td width="48%" height="21" class="perfilsubtit" style="background-color:#D4EDFE">Promociones</td></tr>
		<tr><td class="black12" align="center"><textarea name="promocion1" id="promocion1" cols="45" rows="5">'.$array['promocion1'].'</textarea></td><td>&nbsp;</td>
            <td class="black12" align="center"><textarea name="promocion2" id="promocion2" cols="45" rows="5">'.$array['promocion2'].'</textarea></td></tr>
		<tr><td height="21">&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
		<tr><td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Promociones</td><td>&nbsp;</td>
            <td height="21" class="perfilsubtit" style="background-color:#D4EDFE">Promociones</td></tr>
		<tr><td class="black12" align="center"><textarea name="promocion3" id="promocion3" cols="45" rows="5">'.$array['promocion3'].'</textarea></td><td>&nbsp;</td>
        	<td class="black12" align="center"><textarea name="promocion4" id="promocion4" cols="45" rows="5">'.$array['promocion4'].'</textarea></td></tr>
		<tr><td height="21">&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
		<tr><td height="21" colspan="3"><div align="center">
		  <input type="submit" name="act_promos" id="act_promos" value="Actualizar Promociones" />
		</div></td></tr>
	</table>
	</div></form>';
	return $text;
	}
// Modulo de Autos
function autos_perfil($idcliente)
	{
	$text = '
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="3" height="21" class="perfilsubtit"><a href="miperfil.php?module=pautos">Agregar Auto</a></td></tr>
		<tr><td colspan="3" height="21" bgcolor="#f6f6f6" class="perfilsubtit">Autos</td></tr>';
	require('abrirdb.php');
	$sql = mysql_query("SELECT * FROM perfil_auto where id_cliente = '$idcliente'");
	while($array = mysql_fetch_array($sql))
		{$text .= '
		<tr><td width="27%" rowspan="7" class="black12"><img src="autos/'.$array['imagen'].'" width="150" height="120" /></td>
			<td width="9%" class="black12" align="right"><strong>Marca:&nbsp;</strong></td><td width="64%" class="black12">'.$array['marca'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Modelo:&nbsp;</strong></td><td class="black12">'.$array['modelo'].'</td></tr>
		<tr><td class="black12" align="right"><strong>A&ntilde;o:&nbsp;</strong></td><td class="black12">'.$array['anio'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Transmisi&oacute;n:&nbsp;</strong></td><td class="black12">'.$array['transmision'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Precio:&nbsp;</strong></td><td class="black12">$'.number_format($array['precio'],2,'.',',').'</td></tr>
		<tr><td class="black12" align="right"><strong>Ubicaci&oacute;n:&nbsp;</strong></td>
		  	<td class="black12">'.$array['ubicacion'].'</td></tr>
		<tr><td colspan="2" align="right" class="black12"><div align="left"><a href="miperfil.php?module=galeriaauto&idauto='.$array['id_perfilauto'].'">Galeria de Imagenes</a> | <a href="miperfil.php?module=eautos&idauto='.$array['id_perfilauto'].'">Editar</a> | <a href="miperfil.php?module=dautos&idauto='.$array['id_perfilauto'].'">Borrar</a></div></td></tr>
		<tr><td colspan="3">&nbsp;</td></tr>';
    	}
    $text .= '</table>';
	return $text;
	}

function pautos($idcliente)
	{
	$text = '<form action="actions.php" method="post" enctype="multipart/form-data">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="3" height="21" class="perfilsubtit"><a href="miperfil.php?subsection=autos">Regresar a Perfil</a></td></tr>
		<tr><td colspan="3" height="21" bgcolor="#f6f6f6" class="perfilsubtit">Autos</td></tr>
		<tr><td width="30%" rowspan="5" class="black12"><strong>Imagen: </strong>
		  <input type="file" name="imagen" id="imagen" class="cajasafiliate" /></td>
		<td width="23%" class="black12" align="right"><strong>Marca:&nbsp;</strong></td><td width="47%"><input type="text" name="marca" id="marca" class="cajasafiliate" /></td></tr>
		<tr><td class="black12" align="right"><strong>Modelo:&nbsp;</strong></td><td><input type="text" name="modelo" id="modelo" class="cajasafiliate" /></td></tr>
		<tr><td class="black12" align="right"><strong>A&ntilde;o:&nbsp;</strong></td><td><input type="text" name="anio" id="anio" class="cajasafiliate" /></td></tr>
		<tr><td class="black12" align="right"><strong>Transmisi&oacute;n:&nbsp;</strong></td><td><input type="text" name="transmision" id="transmision" class="cajasafiliate" /></td></tr>
		<tr><td class="black12" align="right"><strong>Precio:&nbsp;</strong></td><td><input type="text" name="precio" id="precio" class="cajasafiliate" /></td></tr>
		<tr><td width="30%" class="black12" align="center"><input type="submit" name="new_auto" id="new_auto" value="Agregar Auto" /></td>
  	    <td class="black12" align="right"><strong>Ubicaci&oacute;n:&nbsp;</strong></td><td><input type="text" name="ubicacion" id="ubicacion" class="cajasafiliate" /></td></tr>
		<tr><td colspan="3" align="center"><img src="imagenes/barra.jpg" width="350" height="1" /></td></tr>
        <tr><td colspan="3">&nbsp;</td></tr>';
	require('abrirdb.php');
	$sql = mysql_query("SELECT * FROM perfil_auto where id_cliente = '$idcliente'");
	while($array = mysql_fetch_array($sql))
		{$text .= '
		<tr><td width="30%" rowspan="6" class="black12"><img src="autos/'.$array['imagen'].'" width="150" height="120" /></td>
			<td width="23%" class="black12" align="right"><strong>Marca:&nbsp;</strong></td><td width="47%" class="black12">'.$array['marca'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Modelo:&nbsp;</strong></td><td class="black12">'.$array['modelo'].'</td></tr>
		<tr><td class="black12" align="right"><strong>A&ntilde;o:&nbsp;</strong></td><td class="black12">'.$array['anio'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Transmisi&oacute;n:&nbsp;</strong></td><td class="black12">'.$array['transmision'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Precio:&nbsp;</strong></td><td class="black12">$'.number_format($array['precio'],2,'.',',').'</td></tr>
		<tr><td class="black12" align="right"><strong>Ubicaci&oacute;n:&nbsp;</strong></td><td class="black12">'.$array['ubicacion'].'</td></tr>
		<tr><td align="right" class="black12"><div align="left"></div></td>
		  <td colspan="2" align="right" class="black12"><div align="center"><a href="miperfil.php?module=galeriaauto&idauto='.$array['id_perfilauto'].'">Galeria de Imagenes</a> | <a href="miperfil.php?module=eautos&idauto='.$array['id_perfilauto'].'">Editar</a> | <a href="miperfil.php?module=dautos&idauto='.$array['id_perfilauto'].'">Borrar</a></div></td>
        </tr>
		<tr><td colspan="3">&nbsp;</td></tr>';
    	}
    $text .= '</table>
	</form>';
	return $text;
	}

function eautos($idcliente,$dauto)
	{
	require('abrirdb.php');
	$sqla = mysql_query("SELECT * FROM perfil_auto WHERE id_cliente = '$idcliente' AND id_perfilauto ='$dauto'");
	$arraya = mysql_fetch_array($sqla);
	$text = '<form action="actions.php" method="post" enctype="multipart/form-data">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="3" height="21" class="perfilsubtit"><a href="miperfil.php?subsection=autos">Regresar a Perfil</a></td></tr>
		<tr><td colspan="3" height="21" bgcolor="#f6f6f6" class="perfilsubtit">Editar Autos</td></tr>
		<tr><td width="30%" rowspan="6" class="black12"><strong><img src="autos/'.$arraya['imagen'].'" width="150" height="120" /><br />Cambiar Imagen: </strong>
	  	    <input type="file" name="imagen" id="imagen" class="cajasafiliate" /></td>
			<td width="23%" class="black12" align="right"><strong>Marca:&nbsp;</strong></td>
        	<td width="47%"><input name="marca" type="text" class="cajasafiliate" id="marca" value="'.$arraya['marca'].'" /></td></tr>
		<tr><td class="black12" align="right"><strong>Modelo:&nbsp;</strong></td>
        	<td><input name="modelo" type="text" class="cajasafiliate" id="modelo" value="'.$arraya['modelo'].'" /></td></tr>
		<tr><td class="black12" align="right"><strong>A&ntilde;o:&nbsp;</strong></td>
        	<td><input name="anio" type="text" class="cajasafiliate" id="anio" value="'.$arraya['anio'].'" /></td></tr>
		<tr><td class="black12" align="right"><strong>Transmisi&oacute;n:&nbsp;</strong></td>
        	<td><input name="transmision" type="text" class="cajasafiliate" id="transmision" value="'.$arraya['transmision'].'" /></td></tr>
		<tr><td align="right" class="black12"><strong>Precio:&nbsp;</strong></td>
        	<td><input name="precio" type="text" class="cajasafiliate" id="precio" value="'.$arraya['precio'].'" /></td></tr>
		<tr><td align="right" class="black12"><strong>Ubicaci&oacute;n:&nbsp;</strong></td>
		  <td><input name="ubicacion" type="text" class="cajasafiliate" id="ubicacion" value="'.$arraya['ubicacion'].'" /></td></tr>
		<tr><td colspan="3" align="center" class="black12"><input type="submit" name="edit_auto" id="edit_auto" value="Editar Auto" /></td></tr>
		<tr><td colspan="3" align="center"><img src="imagenes/barra.jpg" width="350" height="1" /></td></tr>
        <tr><td colspan="3">&nbsp;<input name="idauto" type="hidden" value="'.$dauto.'" /></td></tr>';
	require('abrirdb.php');
	$sql = mysql_query("SELECT * FROM perfil_auto where id_cliente = '$idcliente'");
	while($array = mysql_fetch_array($sql))
		{$text .= '
		<tr><td width="30%" rowspan="6" class="black12"><img src="autos/'.$array['imagen'].'" width="150" height="120" /></td>
			<td width="23%" class="black12" align="right"><strong>Marca:&nbsp;</strong></td><td width="47%" class="black12">'.$array['marca'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Modelo:&nbsp;</strong></td><td class="black12">'.$array['modelo'].'</td></tr>
		<tr><td class="black12" align="right"><strong>A&ntilde;o:&nbsp;</strong></td><td class="black12">'.$array['anio'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Transmisi&oacute;n:&nbsp;</strong></td><td class="black12">'.$array['transmision'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Precio:&nbsp;</strong></td><td class="black12">$'.number_format($array['precio'],2,'.',',').'</td></tr>
		<tr><td class="black12" align="right"><strong>Ubicaci&oacute;n:&nbsp;</strong></td><td class="black12">'.$array['ubicacion'].'</td></tr>
		<tr><td align="right" class="black12"><div align="left"></div></td>
		  <td colspan="2" align="right" class="black12"><div align="center"><a href="miperfil.php?module=galeriaauto&idauto='.$array['id_perfilauto'].'">Galeria de Imagenes</a> | <a href="miperfil.php?module=eautos&idauto='.$array['id_perfilauto'].'">Editar</a> | <a href="miperfil.php?module=dautos&idauto='.$array['id_perfilauto'].'">Borrar</a></div></td>
	      </tr>
		<tr><td colspan="3">&nbsp;</td></tr>';
    	}
    $text .= '</table>
	</form>';
	return $text;
	}

function dautos($idcliente,$dauto)
	{
	require('abrirdb.php');
	$sqla = mysql_query("SELECT * FROM perfil_auto WHERE id_cliente = '$idcliente' AND id_perfilauto ='$dauto'");
	$arraya = mysql_fetch_array($sqla);
	$text = '<form action="actions.php" method="post" enctype="multipart/form-data">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="3" height="21" class="perfilsubtit"><a href="miperfil.php?subsection=autos">Regresar a Perfil</a></td></tr>
		<tr><td colspan="3" height="21" bgcolor="#f6f6f6" class="perfilsubtit">Borrar Autos</td></tr>
		<tr><td width="30%" rowspan="6" class="black12"><strong><img src="autos/'.$arraya['imagen'].'" width="150" height="120" /></strong></td>
			<td width="23%" class="black12" align="right"><strong>Marca:&nbsp;</strong></td><td width="47%" class="black12">'.$arraya['marca'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Modelo:&nbsp;</strong></td><td class="black12">'.$arraya['modelo'].'</td></tr>
		<tr><td class="black12" align="right"><strong>A&ntilde;o:&nbsp;</strong></td><td class="black12">'.$arraya['anio'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Transmisi&oacute;n:&nbsp;</strong></td><td class="black12">'.$arraya['transmision'].'</td></tr>
		<tr><td align="right" class="black12"><strong>Precio:&nbsp;</strong></td><td class="black12">$'.number_format($arraya['precio'],2,'.',',').'</td></tr>
		<tr><td align="right" class="black12"><strong>Ubicaci&oacute;n:&nbsp;</strong></td><td class="black12">'.$arraya['ubicacion'].'</td></tr>
		<tr><td colspan="3" align="center" class="black12"><input type="submit" name="delete_auto" id="delete_auto" value="Borrar Auto" /></td></tr>
		<tr><td colspan="3" align="center"><img src="imagenes/barra.jpg" width="350" height="1" /></td></tr>
        <tr><td colspan="3">&nbsp;<input name="idauto" type="hidden" value="'.$dauto.'" /></td></tr>';
	require('abrirdb.php');
	$sql = mysql_query("SELECT * FROM perfil_auto where id_cliente = '$idcliente'");
	while($array = mysql_fetch_array($sql))
		{$text .= '
		<tr><td width="30%" rowspan="6" class="black12"><img src="autos/'.$array['imagen'].'" width="150" height="120" /></td>
			<td width="23%" class="black12" align="right"><strong>Marca:&nbsp;</strong></td><td width="47%" class="black12">'.$array['marca'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Modelo:&nbsp;</strong></td><td class="black12">'.$array['modelo'].'</td></tr>
		<tr><td class="black12" align="right"><strong>A&ntilde;o:&nbsp;</strong></td><td class="black12">'.$array['anio'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Transmisi&oacute;n:&nbsp;</strong></td><td class="black12">'.$array['transmision'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Precio:&nbsp;</strong></td><td class="black12">$'.number_format($array['precio'],2,'.',',').'</td></tr>
		<tr><td class="black12" align="right"><strong>Ubicaci&oacute;n:&nbsp;</strong></td><td class="black12">'.$array['ubicacion'].'</td></tr>
		<tr><td align="right" class="black12"><div align="left"></div></td>
		  <td colspan="2" align="right" class="black12"><div align="center"><a href="miperfil.php?module=galeriaauto&idauto='.$array['id_perfilauto'].'">Galeria de Imagenes</a> | <a href="miperfil.php?module=eautos&idauto='.$array['id_perfilauto'].'">Editar</a> | <a href="miperfil.php?module=dautos&idauto='.$array['id_perfilauto'].'">Borrar</a></div></td></tr>
		<tr><td colspan="3">&nbsp;</td></tr>';
    	}
    $text .= '</table>
	</form>';
	return $text;
	}

function galeriaauto($idcliente,$idauto)
	{
	require('abrirdb.php');
	$sqla = mysql_query("SELECT * FROM perfil_auto WHERE id_cliente = '$idcliente' AND id_perfilauto ='$idauto'");
	$arraya = mysql_fetch_array($sqla);
	$text = '
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="3" height="21" class="perfilsubtit"><a href="miperfil.php?subsection=autos">Regresar a Perfil</a></td></tr>
		<tr><td colspan="3" height="21" bgcolor="#f6f6f6" class="perfilsubtit">Galeria de Autos</td></tr>
		<tr><td width="30%" rowspan="6" class="black12"><strong><img src="autos/'.$arraya['imagen'].'" width="150" height="120" /></strong></td>
			<td width="23%" class="black12" align="right"><strong>Marca:&nbsp;</strong></td><td width="47%" class="black12">'.$arraya['marca'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Modelo:&nbsp;</strong></td><td class="black12">'.$arraya['modelo'].'</td></tr>
		<tr><td class="black12" align="right"><strong>A&ntilde;o:&nbsp;</strong></td><td class="black12">'.$arraya['anio'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Transmisi&oacute;n:&nbsp;</strong></td><td class="black12">'.$arraya['transmision'].'</td></tr>
		<tr><td align="right" class="black12"><strong>Precio:&nbsp;</strong></td><td class="black12">$'.number_format($arraya['precio'],2,'.',',').'</td></tr>
		<tr><td align="right" class="black12"><strong>Ubicaci&oacute;n:&nbsp;</strong></td><td class="black12">'.$arraya['ubicacion'].'</td></tr>
	</table>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="2" bgcolor="#f6f6f6" class="perfilsubtit"><a href="miperfil.php?module=agaleriaauto&idauto='.$idauto.'">Agregar Imagen</a></td></tr>
		<tr><td>&nbsp;</td><td>&nbsp;</td></tr>';
	require('abrirdb.php');
	$sql = mysql_query("select * from galeria_auto where id_perfilauto = '$idauto' and id_cliente='$idcliente'");
	while($array=mysql_fetch_array($sql))
		{ $text .= '
		<tr><td><img src="galeria_auto/'.$array['imagen'].'" width="150" height="120" /></td>
			<td width="71%"><a href="miperfil.php?module=bgaleriaauto&idauto='.$array['id_galeriaauto'].'">Borrar</a></td></tr>
		<tr><td>&nbsp;</td><td>&nbsp;</td></tr>';
		}
	$text .= '</table>';
	return $text;
	}
	
function agaleriaauto($idcliente,$idauto)
	{
	require('abrirdb.php');
	$sqla = mysql_query("SELECT * FROM perfil_auto WHERE id_cliente = '$idcliente' AND id_perfilauto ='$idauto'");
	$arraya = mysql_fetch_array($sqla);
	$text = '
    <form action="actions.php" method="post" enctype="multipart/form-data">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="3" height="21" class="perfilsubtit"><a href="miperfil.php?subsection=autos">Regresar a Perfil</a></td></tr>
		<tr><td colspan="3" height="21" bgcolor="#f6f6f6" class="perfilsubtit">Galeria de Autos</td></tr>
		<tr><td width="30%" rowspan="6" class="black12"><strong><img src="autos/'.$arraya['imagen'].'" width="150" height="120" /></strong></td>
			<td width="23%" class="black12" align="right"><strong>Marca:&nbsp;</strong></td><td width="47%" class="black12">'.$arraya['marca'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Modelo:&nbsp;</strong></td><td class="black12">'.$arraya['modelo'].'</td></tr>
		<tr><td class="black12" align="right"><strong>A&ntilde;o:&nbsp;</strong></td><td class="black12">'.$arraya['anio'].'</td></tr>
		<tr><td class="black12" align="right"><strong>Transmisi&oacute;n:&nbsp;</strong></td><td class="black12">'.$arraya['transmision'].'</td></tr>
		<tr><td align="right" class="black12"><strong>Precio:&nbsp;</strong></td><td class="black12">$'.number_format($arraya['precio'],2,'.',',').'</td></tr>
		<tr><td align="right" class="black12"><strong>Ubicaci&oacute;n:&nbsp;</strong></td><td class="black12">'.$arraya['ubicacion'].'</td></tr>
	</table>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="2" bgcolor="#f6f6f6" class="perfilsubtit"><a href="miperfil.php?module=galeriaauto&idauto='.$idauto.'">Regresar a Galeria</a></td></tr>
		<tr><td>&nbsp;</td><td>&nbsp;<input name="idauto" type="hidden" value="'.$idauto.'" /></td></tr>
		<tr><td><input type="file" name="imagen" id="imagen" /></td>
			<td width="71%"><input type="submit" name="add_galeria" id="add_galeria" value="Agregar Imagen" /></td></tr>
	</table></form>';
	return $text;
	}

function bgaleriaauto($idcliente,$idauto)
	{
	require('abrirdb.php');
	$sql = mysql_query("SELECT * FROM galeria_auto WHERE id_cliente = '$idcliente' AND id_galeriaauto ='$idauto'");
	$array = mysql_fetch_array($sql);
	$text = '<form action="actions.php" method="post">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="2" bgcolor="#f6f6f6" class="perfilsubtit"><a href="miperfil.php?module=galeriaauto&idauto='.$idauto.'">Regresar a Galeria</a></td></tr>
		<tr><td>&nbsp;</td><td>&nbsp;<input name="idauto" type="hidden" value="'.$idauto.'" /></td></tr>
		<tr><td><img src="galeria_auto/'.$array['imagen'].'" width="150" height="120" /></td>
			<td width="71%"><input type="submit" name="del_galeria" id="del_galeria" value="Borrar Imagen" /></td></tr>
	</table></form>';
	return $text;
	}
// Modulo de Refacciones
function refacciones_perfil($idcliente)
	{
	$text = '
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="5" height="21" class="perfilsubtit"><a href="miperfil.php?module=prefaccion">Agregar Refaccion</a></td></tr>
		<tr><td colspan="5" height="21" bgcolor="#f6f6f6" class="perfilsubtit">Refacciones</td></tr>
		<tr><td width="15%" height="21" class="perfilsubtit">Marca</td>
			<td width="40%" class="perfilsubtit">Pieza</td>
			<td width="15%" class="perfilsubtit">Precio</td>
			<td width="15%" height="21" class="perfilsubtit">Editar</td>
			<td width="15%" height="21" class="perfilsubtit">Borrar</td></tr>';
	require('abrirdb.php');
	$sql = mysql_query("SELECT * FROM perfil_refaccion where id_cliente = '$idcliente'");
	while($array = mysql_fetch_array($sql))
		{$text .= '
        <tr><td height="21" class="black12">'.$array['marca'].'</td>
		  <td class="black12">'.$array[pieza].'</td>
		  <td class="black12">$'.number_format($array['precio'],2,'.',',').'</td>
		  <td height="21" class="black12"><a href="miperfil.php?module=erefaccion&idrefaccion='.$array['id_refaccion'].'">Editar</a></td>
		  <td height="21" class="black12"><a href="miperfil.php?module=drefaccion&idrefaccion='.$array['id_refaccion'].'">Borrar</a></td></tr>';
    	}
    $text .= '</table>';
	return $text;
	}

function prefaccion($idcliente)
	{
	$text = '<form action="actions.php" method="post">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="4" height="21" class="perfilsubtit"><a href="miperfil.php?subsection=refacciones">Regresar a lista de Refacciones</a></td></tr>
		<tr><td colspan="4" height="21" bgcolor="#f6f6f6" class="perfilsubtit">Refacciones</td></tr>
		<tr><td class="perfilsubtit" align="right">No. Pieza:</td><td><input type="text" name="nopieza" id="nopieza" class="black12" /></td>
			<td class="perfilsubtit" align="right">Refaccion:</td><td><input type="text" name="parte" id="parte" class="black12" /></td></tr>
		<tr><td class="perfilsubtit" align="right">Marca:</td><td><input type="text" name="marca" id="marca" class="black12" /></td>
			<td class="perfilsubtit" align="right">Modelo:</td><td><input type="text" name="modelo" id="modelo" class="black12" /></td></tr>
		<tr><td class="perfilsubtit" align="right">Desde a&ntilde;o:</td><td><input type="text" name="desde" id="desde" class="black12" /></td>
			<td class="perfilsubtit" align="right">Hasta a&ntilde;o:</td><td><input type="text" name="hasta" id="hasta" class="black12" /></td></tr>
		<tr><td class="perfilsubtit" align="right">Precio:</td><td colspan="3"><input type="text" name="precio" id="precio" class="black12" /></td></tr>
		<tr><td width="15%">&nbsp;</td><td width="35%">&nbsp;</td><td width="15%">&nbsp;</td><td width="35%">&nbsp;</td></tr>
		<tr><td colspan="4" align="center" class="black12"><input type="submit" name="save_refaccion" id="save_refaccion" value="Guardar Refacci&oacute;n" /></td></tr>
		<tr><td colspan="4" align="center"><img src="imagenes/barra.jpg" width="350" height="1" /></td></tr>
	</table></form>';
	return $text;
	}

function erefaccion($idcliente,$dauto)
	{
	require('abrirdb.php');
	$sql = mysql_query("SELECT * FROM perfil_refaccion WHERE id_cliente = '$idcliente' AND id_refaccion ='$dauto'");
	$array = mysql_fetch_array($sql);
	$text = '
	<form action="actions.php" method="post">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="4" height="21" class="perfilsubtit"><a href="miperfil.php?subsection=refacciones">Regresar a lista de Refacciones</a></td></tr>
		<tr><td colspan="4" height="21" bgcolor="#f6f6f6" class="perfilsubtit">Refacciones</td></tr>
		<tr><td class="perfilsubtit" align="right">No. Pieza:</td><td><input type="text" name="nopieza" id="nopieza" value="'.$array['pieza'].'" class="black12" /></td>
			<td class="perfilsubtit" align="right">Refaccion:</td><td><input type="text" name="parte" id="parte" value="'.$array['parte'].'" class="black12" /></td></tr>
		<tr><td class="perfilsubtit" align="right">Marca:</td><td><input type="text" name="marca" id="marca" value="'.$array['marca'].'" class="black12" /></td>
			<td class="perfilsubtit" align="right">Modelo:</td><td><input type="text" name="modelo" id="modelo" value="'.$array['modelo'].'" class="black12" /></td></tr>
		<tr><td class="perfilsubtit" align="right">Desde a&ntilde;o:</td><td><input type="text" name="desde" id="desde" value="'.$array['desde'].'" class="black12" /></td>
			<td class="perfilsubtit" align="right">Hasta a&ntilde;o:</td><td><input type="text" name="hasta" id="hasta" value="'.$array['hasta'].'" class="black12" /></td></tr>
		<tr><td class="perfilsubtit" align="right">Precio:</td><td colspan="3"><input type="text" name="precio" id="precio" value="'.$array['precio'].'" class="black12" /></td></tr>
		<tr><td width="15%">&nbsp;</td><td width="35%">&nbsp;</td><td width="15%">&nbsp;</td><td width="35%">&nbsp;</td></tr>
		<tr><td colspan="4" align="center" class="black12"><input type="submit" name="edit_refaccion" id="edit_refaccion" value="Editar Refacci&oacute;n" /></td></tr>
		<tr><td colspan="4">&nbsp;<input name="idauto" type="hidden" value="'.$dauto.'" /></td></tr>
		<tr><td colspan="4" align="center"><img src="imagenes/barra.jpg" width="350" height="1" /></td></tr>
	</table>
	</form>';
	return $text;
	}

function drefaccion($idcliente,$dauto)
	{
	require('abrirdb.php');
	$sql = mysql_query("SELECT * FROM perfil_refaccion WHERE id_cliente = '$idcliente' AND id_refaccion ='$dauto'");
	$array = mysql_fetch_array($sql);
	$text = '
	<form action="actions.php" method="post">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="4" height="21" class="perfilsubtit"><a href="miperfil.php?subsection=refacciones">Regresar a lista de Refacciones</a></td></tr>
		<tr><td colspan="4" height="21" bgcolor="#f6f6f6" class="perfilsubtit">Refacciones</td></tr>
		<tr><td class="perfilsubtit" align="right">No. Pieza:</td><td class="black12">&nbsp;'.$array['pieza'].'</td>
			<td class="perfilsubtit" align="right">Refaccion:</td><td class="black12">&nbsp;'.$array['parte'].'</td></tr>
		<tr><td class="perfilsubtit" align="right">Marca:</td><td class="black12">&nbsp;'.$array['marca'].'</td>
			<td class="perfilsubtit" align="right">Modelo:</td><td class="black12">&nbsp;'.$array['modelo'].'</td></tr>
		<tr><td class="perfilsubtit" align="right">Desde a&ntilde;o:</td><td class="black12">&nbsp;'.$array['desde'].'</td>
			<td class="perfilsubtit" align="right">Hasta a&ntilde;o:</td><td class="black12">&nbsp;'.$array['hasta'].'</td></tr>
		<tr><td class="perfilsubtit" align="right">Precio:</td><td colspan="3" class="black12">&nbsp;$'.$array['precio'].'</td></tr>
		<tr><td width="15%">&nbsp;</td><td width="35%">&nbsp;</td><td width="15%">&nbsp;</td><td width="35%">&nbsp;</td></tr>
		<tr><td colspan="4" align="center" class="black12"><input type="submit" name="delete_refaccion" id="delete_refaccion" value="Borrar Refacci&oacute;n" /></td></tr>
		<tr><td colspan="4">&nbsp;<input name="idauto" type="hidden" value="'.$dauto.'" /></td></tr>
		<tr><td colspan="4" align="center"><img src="imagenes/barra.jpg" width="350" height="1" /></td></tr>
	</table>
	</form>';
	return $text;
	}

function menu_general()
	{
	$text = '
<form action="resultados.php" method="get">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr><td height="54" colspan="2" align="center" style="vertical-align:middle">
		<table width="1100" border="0" cellspacing="0" cellpadding="0" align="center">
			<tr><td width="142" align="left" class="blue12" style="vertical-align:middle"><a href="index.php"><strong>Volver al inicio</strong></a></td>
			<td width="492" height="30" align="left" style="vertical-align:top"><input name="cadena" type="text" class="cajas" id="cadena" value="" /></td>
			<td width="116" align="left" style="vertical-align:top"><input name="buscar" type="submit" class="btn" id="buscar" value=" " /></td>
			<td width="350" align="left" class="blue12" style="vertical-align:middle"><strong><a id="tipocte" href="tipocte.php">Anunciate gratis</a> | <a id="login" href="login.php">Mi cuenta</a></strong></td></tr>
        </table></td></tr>
    <tr><td height="40" colspan="2">
    	<table width="1100" border="0" cellspacing="0" cellpadding="0" align="center">
		    <tr><td width="13%" height="40" class="confondo">&nbsp;</td>
				<td width="87%" height="40" class="confondo enblanco" style="vertical-align:middle">
        <img src="imagenes/backbluedark.jpg" width="1" height="20" style="vertical-align:middle" />&nbsp;<a id="bienvenido" href="bienvenido.php" class="enblanco">Bienvenido</a>&nbsp;
		<img src="imagenes/backbluedark.jpg" width="1" height="20" style="vertical-align:middle"  />&nbsp;<a href="empresa.php" class="enblanco">Nosotros</a>&nbsp;
		<img src="imagenes/backbluedark.jpg" width="1" height="20" style="vertical-align:middle"  />&nbsp;<a href="chicasayr.php" class="enblanco">Chicas AyR</a>&nbsp;
        <img src="imagenes/backbluedark.jpg" width="1" height="20" style="vertical-align:middle"  />&nbsp;<a href="contactanos.php" class="enblanco">Comentarios</a>&nbsp;
        <img src="imagenes/backbluedark.jpg" width="1" height="20" style="vertical-align:middle"  /></td></tr>
        <tr><td colspan="2">&nbsp;</td></tr>
		</table></td></tr>
</table>
</form>';
	return $text;
	}
    
function plogo($idcliente)
	{
	echo '<form action="actions.php" method="post" enctype="multipart/form-data">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td align="center" class="black12">Selecciona la imagen a usar</td></tr>
		<tr><td>&nbsp;</td></tr>
		<tr><td align="center" class="black12"><input type="file" name="mylogo" id="mylogo" /></td></tr>
		<tr><td align="center" class="black12">* Unicamente valido formato JPG, PNG o GIF</td></tr>
		<tr><td>&nbsp;<input name="idcliente" id="idcliente" type="hidden" value="'.$idcliente.'" /></td></tr>
		<tr><td align="center" class="black12"><input type="submit" name="add_logo" id="add_logo" value="Guardar Imagen" /></td></tr>
	</table>
	</form>';
	}
?>